#@layout() #define main()
<div class="xp-layout">
	<form id="deptForm" action="att/edit" method="post" class="layui-form layui-form-pane">
		<input type="hidden" id="state" name="acceptanceteam.dataStatus" value="1">
		<div class="layui-form-item">
			<div class="layui-col-md6 layui-col-sm6 xp-col-padding5">
				<label class="layui-form-label">考场名称</label>
				<div class="layui-input-block">
						<select id="eId" name="acceptanceteam.eId" lay-filter="changebh"> 
						#@option(examinationList,"ID","name",acceptanceteam.eId??!=null ? (acceptanceteam.eId??) : eId,false)
						</select>
				</div>
			</div>
			
			<div class="layui-col-md6 layui-col-sm6 xp-col-padding5">
				<label class="layui-form-label">设备信息</label>
				<div class="layui-input-block">
						<select id="dId" name="acceptanceteam.dId" lay-filter="changebh"> 
						#@option(deviceList,"id","syr",acceptanceteam.dId??!=null ? (acceptanceteam.dId??) : dId,false)
						</select>
				</div>
			</div>
			
		</div>
		<div class="layui-form-item">
			<div class="layui-col-md6 layui-col-sm6 xp-col-padding5">
				<label class="layui-form-label">专家1姓名</label>
				<div class="layui-input-block">
					<input type="text" name="acceptanceteam.name1"  value="#(acceptanceteam.name1??)"   maxlength="50" autocomplete="off" placeholder="请输入第一位专家姓名" class="layui-input">
				</div>
			</div>
			<div class="layui-col-md6 layui-col-sm6 xp-col-padding5">
				<label class="layui-form-label">专家1单位</label>
				<div class="layui-input-block">
					<input type="text" name="acceptanceteam.unit1"    value="#(acceptanceteam.unit1??)"    autocomplete="off" placeholder="请输入第一位专家单位" class="layui-input" >
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col-md6 layui-col-sm6 xp-col-padding5">
				<label class="layui-form-label">专家2姓名</label>
				<div class="layui-input-block">
					<input type="text" name="acceptanceteam.name2"   value="#(acceptanceteam.name2??)"    maxlength="50" autocomplete="off" placeholder="请输入第二位专家姓名" class="layui-input">
				</div>
			</div>
			<div class="layui-col-md6 layui-col-sm6 xp-col-padding5">
				<label class="layui-form-label">专家2单位</label>
				<div class="layui-input-block">
					<input type="text" name="acceptanceteam.unit2"  value="#(acceptanceteam.unit2??)"   autocomplete="off" placeholder="请输入第二位专家单位" class="layui-input" >
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col-md6 layui-col-sm6 xp-col-padding5">
				<label class="layui-form-label">专家3姓名</label>
				<div class="layui-input-block">
					<input type="text" name="acceptanceteam.name3" value="#(acceptanceteam.name3??)"  maxlength="50" autocomplete="off" placeholder="请输入第三位专家姓名" class="layui-input">
				</div>
			</div>
			<div class="layui-col-md6 layui-col-sm6 xp-col-padding5">
				<label class="layui-form-label">专家3单位</label>
				<div class="layui-input-block">
					<input type="text" name="acceptanceteam.unit3"  value="#(acceptanceteam.unit3??)"  autocomplete="off" placeholder="请输入第三位专家单位" class="layui-input" >
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-col-md6 layui-col-sm6 xp-col-padding5">
				<label class="layui-form-label">验证码</label>
				<div class="layui-input-block">
				<input type="text" name="acceptanceteam.yzm"  value="#(acceptanceteam.yzm??)"   lay-verify="required" autocomplete="off" class="layui-input" >
				</div>
			</div>
			<input type="hidden" id="checkStatus" value="#(acceptanceteam.checkStatus??)"  lay-verify="required" autocomplete="off" class="layui-input">
			<input type="hidden" name="acceptanceteam.ID" id="checkStatus" value="#(acceptanceteam.ID??)"  lay-verify="required" autocomplete="off" class="layui-input">
			<div class="layui-col-md6 layui-col-sm6 xp-col-padding5">
			
				<label class="layui-form-label">初验复验</label>
				<div class="layui-input-block">
				<select id="accep" name="acceptanceteam.checkStatus"    lay-filter="changebh"> 
						<option value="1"  >初验</option>
						<option value="2"   >复验</option>
				</select>
				</div>
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-col-md6 layui-col-sm6 xp-col-padding5">
				<label class="layui-form-label">邮箱</label>
				<div class="layui-input-block">
				<input type="text" name="acceptanceteam.zjyx"  value="#(acceptanceteam.zjyx??)" lay-verify="required" autocomplete="off" class="layui-input" >
				</div>
			</div>
			
		</div>
		
		<div class="layui-form-item">
			<div style="text-align: center;">
				<button class="layui-btn" lay-submit="" lay-filter="go">立即提交</button>
			</div>
		</div>
	</form>
	<script type="text/javascript">
	

	var num = $("#checkStatus").val();   //获取input中输入的数字
	var numbers = $("#accep").find("option"); //获取select下拉框的所有值
	for (var j = 1; j < numbers.length; j++) {
	if ($(numbers[j]).val() == num) {
	$(numbers[j]).attr("selected", "selected");
	}
	
	}
	
	
	
	
	
		layui.use([ 'form', 'laydate' ], function() {
			var form = layui.form, layer = layui.layer, laydate = layui.laydate;

			//监听指定开关
			form.on('switch(switchState)', function(data) {
				$("#state").val(this.checked ? '1' : '0');
			});

			//监听提交
			form.on('submit(go)', function(data) {
				var url = $('#deptForm').attr('action');
				$.post(url, data.field, function(res) {
					if (res.result == 1) {
						layer.msg(res.msg, {
							icon : 1,
							time : 1000
						}, function() {
							var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
							parent.layer.close(index); //再执行关闭  
							parent.reloadList();//重新reload列表
						});
					} else {
						layer.msg(res.msg, {
							icon : 5
						});
					}
				});
				return false;
			});
		});
		function right(ID) {
			layer.open({
				type : 2,
				title : '编辑部门权限',
				area : [ '60%', '60%' ],
				shade : 0,
				maxmin : true,
				id : 'deptRight_iframe',
				content : 'xpDepartment/right_ui?ID=' + ID,
				btn : [ '提交', '关闭' ],
				yes : function(index, layero) {
					var iframeWin = window[layero.find('iframe')[0]['name']];
					iframeWin.saveRight();
				},
				btn2 : function(index, layero) {
				},
				zIndex : layer.zIndex,
				success : function(layero) {
					layer.setTop(layero);
				}
			});
		}
	</script>
</div>
#end
